I. Field
The present disclosure relates generally to electronics, and more specifically to techniques for providing storage for multiple software programs.
II. Background
Many electronics devices are capable of executing multiple software programs in parallel. For example, a graphics processor may execute multiple graphics programs for applications such as video games, graphics, imaging, etc. Each program is a sequence of instructions. A program counter may be maintained for each program and may point to the current instruction to be executed for the program.
The programs being executed may be large and thus stored in a mass storage unit. To improve operating speed, a small portion of each program may be loaded from the mass storage unit onto an instruction cache, which is a fast memory located closer to the processor. The instruction cache may store instructions for all programs being executed. To improve utilization of the instruction cache, the programs may share the same address space within the cache. This would then allow each cache location to store an instruction for any program.
A major issue with storing instructions for multiple programs in one cache is “instruction thrashing” among the programs. Instruction thrashing is a phenomenon in which more than one program contends for the same location of the cache and their instructions continually overwrite one another. Instruction thrashing results in excessive cache misses. A cache miss occurs whenever a desired instruction is not found in the cache. A cache miss causes delays in execution of the instruction since the cache is typically first filled with the instruction, and the instruction is then retrieved and executed. Instruction thrashing may adversely impact performance for all affected programs.